﻿using ServiceHost;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting.Web;

namespace TestProject
{
    
    
    /// <summary>
    ///This is a test class for RouteTest and is intended
    ///to contain all RouteTest Unit Tests
    ///</summary>
    [TestClass()]
    public class RouteTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for IsSafe
        ///</summary>
        [TestMethod()]
        public void IsSafeTest_True()
        {
            Coordinate destination = new Coordinate(139.46667, -24.35);
            Coordinate source = new Coordinate(139.36667, -25.9);
            Route target = RouteHelper.GetRoute(destination, source);

            Coordinate coordinate = new Coordinate(139, -25);
            HotSpot[] hotSpot = HotSpotHelper.GetHotSpots(coordinate);

            bool expected = true; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsSafe(hotSpot);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IsSafe
        ///</summary>
        [TestMethod()]
        public void IsSafeTest_False()
        {
            Coordinate destination = new Coordinate(139.46667, -24.35);
            Coordinate source = new Coordinate(139.36667, -25.9);
            Route target = RouteHelper.GetRoute(destination, source);

            Coordinate coordinate = new Coordinate(129.46667, -24.35);
            HotSpot[] hotSpot = HotSpotHelper.GetHotSpots(coordinate); 
            
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsSafe(hotSpot);
            Assert.AreEqual(expected, actual);
        }

        /// <summary>
        ///A test for IsSafe
        ///</summary>
        [TestMethod()]
        public void IsSafeTest()
        {
            Route target = new Route(); 
            HotSpot[] hotSpots = null; // TODO: Initialize to an appropriate value
            bool expected = false; // TODO: Initialize to an appropriate value
            bool actual;
            actual = target.IsSafe(hotSpots);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for IsSafe
        ///</summary>
        [TestMethod()]
        public void IsSafeTest1()
        {
            Route target = RouteHelper.GetRoute(new Coordinate(132.26, -14.46), new Coordinate(128.76, -15.77));
            HotSpot hotSpot = new HotSpot{Coordinate = new Coordinate(132, -15.19)}; 
            bool expected = false; 
            bool actual;
            actual = target.IsSafe(hotSpot);
            Assert.AreEqual(expected, actual);
        }
    }
}
